package com.credithc.signature.manager.config.staticfile;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @desc: <br/>
 * @author: Jingbo Hu<br/>
 * @time：2020年05⽉15⽇<br/>
 * @version：v1.0.0<br>
 */
@Configuration
public class StaticFilePathConfig extends WebMvcConfigurerAdapter {


    @Value("${signature.tempFile.staticAccessPath:/manual/contract/file/**}")
    private String staticAccessPath;

    @Value("${signature.tempFile.uploadFolder:/data/temp/S3/}")
    private String uploadFolder;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler(staticAccessPath).addResourceLocations("file:" + uploadFolder);
    }
}
